package com.upc.cajabancos.bo;

import java.sql.Connection;
import java.util.List;

import com.upc.cajabancos.dao.ClienteDAO;
import com.upc.cajabancos.model.Cliente;
import com.upc.cajabancos.util.DataAccessObjetc;

public class ClienteBO {
	
	/**
	 * Lista los clientes
	 * @author Cesar Jesus
	 * @since 30/01/2011
	 * @return List<Cliente>
	 */
	public List<Cliente> listar()throws Exception{
		
		ClienteDAO clienteDAO = null;
		
		Connection connection = null;
		List<Cliente> listaClientes = null;
		
		try{
			connection = DataAccessObjetc.getConnection();
			
			clienteDAO = new ClienteDAO(connection);
		
			listaClientes = clienteDAO.listar();
		}
		catch(Exception e){
			e.printStackTrace();
			throw e;
			
		}finally{
			DataAccessObjetc.close(connection);
		}
		return listaClientes;
	}

}
